<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>{$head[title]}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta content="{$head[keywords]}" name="keywords" />
<meta content="{$head[description]}" name="description" />
<base href="{SITE_URL}" />
<link href="favicon.ico" rel="shortcut icon" />
<link href="skin/style.css" rel="stylesheet" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="{$head[title]}" href="/rss.php?rssid={$catid}" />
<script language="JavaScript" src="misc/config.js"></script>
<script language="JavaScript" src="misc/jquery.min.js"></script>
<script language="JavaScript" src="misc/common.js"></script>
<script language="JavaScript" src="misc/validator.js"></script>
</head>
<body>

{template 'header.html'}

<div class="container">
    <div class="aside">
        {template "left.html",'yellowpage'}
    </div>
    
    <div class="main">


        <div class="head">管理留言</div>
        <table cellpadding="0" cellspacing="1" class="table"> 
          <tr>
            <th width="30"><input type="checkbox" onClick="javascript:checkall(this)"/></th>
            <th>留言摘要</th>
            <th width="100">留言人</th>
            <th width="110">留言时间</th>
            <th width="50">状态</th>
            <th width="130">操作</th>
          </tr>
        {loop $infos $info}
        <tr>
            <th width="30"><input type="checkbox" name="gid[]" value="{$info[gid]}"/></th>
            <td>
            <a href="javascript:showMsgCnt('{$info[gid]}'{if $info[status] == 0},false{else},true{/if})"><span class="{$info[style]}">{str_cut($info[content],150,'...')}</span></a>
            </td>
            <td>{$info[username]}</td>
            <td>{date('Y-m-d H:i',$info[addtime])}</td>
            <td>{if $info[status]==0}<font color="red">未读</font>{else}<font color="#009900">已读</font>{/if}</td>
            <td><a href="?module={$module}&file={$file}&action=answer&id={$info[gid]}&userid={$_userid}">详情</a>{if $info[vid]} | 
            <a href="?module=message&action=send&userid={$info[vid]}" target="_blank" title="短消息">短消息</a>{/if} | <a href="javascript:confirmurl('?module={$module}&file={$file}&action=delete&gid={$info[gid]}&userid={$_userid}','确认删除此留言吗？')">删除</a></td>
        </tr>	
        <tr id="cnt{$info[gid]}" style="display:none">			
            <td colspan="6"><p>{$info[content]}</p></td>
        </tr>
        {/loop}
        <tr>
            <th width="30"><input type="checkbox" onClick="javascript:checkall(this)"/></th>
            <td colspan="5"><input type="button" value="删除所选" onClick="javascript:buttondo(true)"/> <input type="button" value="标记为已读" onClick="javascript:buttondo(false)"/></td>
        </tr>
        </table>
        <div class="pagination">{$pages}</div>
        <div class="head">提示信息</div>
        <table cellpadding="0" cellspacing="1" class="table"> 
          <tr>
            <td> 您可以通过标记不同的颜色来区分留意的重要性。
    <br/>
            </td>
          </tr>
        </table>
    
    </div>
    
</div>

 
<script>
var showMsgCnt = function(obj,bool)
{
	var c= obj;
	obj = 'cnt'+obj;
	
	var t = $("#"+obj);
	if(!bool)$.get('?module={$module}&file={$file}&action=answer&id='+c);
	if(t.css("display") != "none")t.hide();
	else t.show();
}

var checkall = function(obj)
{
	$("input[name='gid[]']").attr('checked',obj.checked);
}

var buttondo = function(bool)
{
	var par;
	if(bool)
	{
		par = 'batmethod=delete';
	}
	else
	{
		par = 'batmethod=bookmark';
	}
	$("input[name='gid[]']").each(function(){ if(this.checked)par += '&gid[]='+this.value});
	$.get('?module={$module}&file={$file}&action=batdo&'+par+'&jsrand='+Math.random(),function(data){ if(data=='ok')window.location.reload();});
}
</script>
{template 'footer.html'}